/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package soatonline.VO;

import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 *
 * @author andresdonato
 */
public class Fondo extends JPanel {
            
            private String url="";
            
            
          
            public Fondo (Dimension d, String url) {
                
                this.setSize(d);
                this.url= url;  
                this.repaint();
               }
            public Fondo(Dimension d){
                this.setSize(d);
            }
        
            @Override
            public void paint(Graphics g) {
                Dimension tamanio = getSize();
                ImageIcon imagenFondo = new ImageIcon(getClass().getResource(url));                       
                g.drawImage(imagenFondo.getImage(),0,0,tamanio.width, tamanio.height, null);
                setOpaque(false);
                super.paintComponent(g);
            
            }
        }